<?php

namespace App\Jobs;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;
use Throwable;
class ProcessPodcast implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    /**
     * 任务可尝试次数.优先于命令行上提供的 --tries 开关设定的值
     */
    public $tries = 5;
    /**
     * 标示是否应在超时时标记为失败.
     */
    public $failOnTimeout = true;
    /**
     * 在超时之前任务可以运行的秒数.
     */
    public $timeout = 120;
    public $a;
    public function __construct($a)
    {
        $this->a = $a;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        sleep(3);
        Log::info($this->a);
    }
    // 向用户发送失败通知等...
    public function failed(Throwable $exception)
    {
    }
}
